package cn.webestar.scms.user.api.dto.Message;

import cn.webestar.scms.commons.api.UpdateBody;
import cn.webestar.scms.user.entity.Message;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;

@Data
@Schema(description = "MessageUpdateDTO")
public class MessageUpdateDTO extends UpdateBody {

    private Long id;

    @Schema(description = "租户")
    private Long cid;

    @Schema(description = "消息类型 1：系统消息")
    private Integer type;

    @Schema(description = "标题")
    private String title;

    @Schema(description = "内容")
    private String content;

    @Schema(description = "长引用类型")
    private Integer refType;

    @Schema(description = "长引用id")
    private Long refId;

    @Schema(description = "创建时间")
    private Date createTime;

    @Override
    public Long getId() {
        return id;
    }

    @Override
    public Message toDO() {
        Message o = new Message();
        o.setId(id);
        o.setCid(cid);
        o.setType(type);
        o.setTitle(title);
        o.setContent(content);
        o.setRefType(refType);
        o.setRefId(refId);
        o.setCreateTime(createTime);
        return o;
    }

}
